home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / misc / SpeedBoost.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  541 b   |  23 lines

  1. class classes.misc.SpeedBoost
  2. {
  3.    var cMax;
  4.    var baseSpeed;
  5.    var c = 0;
  6.    var Name = "speedBoost";
  7.    function SpeedBoost(max)
  8.    {
  9.       this.cMax = max;
  10.       this.baseSpeed = _root[_root.char].baseSpeed;
  11.    }
  12.    function main()
  13.    {
  14.       this.c = this.c + 1;
  15.       _root[_root.char].speed = this.baseSpeed + (this.cMax - this.c) / (this.cMax / 3);
  16.       if(this.c == this.cMax)
  17.       {
  18.          _root[_root.char].speed = _root[_root.char].baseSpeed;
  19.          _root.removePowerUp("speedBoost");
  20.       }
  21.    }
  22. }
  23.